snapshot: Don't create clip nodes with 0 width or height
authorTimm Bäder <mail@baedert.org>
Thu, 28 Dec 2017 09:52:57 +0000 (10:52 +0100)
committerTimm Bäder <mail@baedert.org>
Thu, 28 Dec 2017 15:48:35 +0000 (16:48 +0100)
gtk/gtksnapshot.c

index e16e0d3fd79868e7d942263c3bee82b9e76f8996..45bb205c0c022caf4dde893b3c2cc8aefffa53db 100644 (file)
@@ -589,6 +589,10 @@ gtk_snapshot_collect_clip (GtkSnapshot      *snapshot,
   if (graphene_rect_contains_rect (&state->data.clip.bounds, &node->bounds))
     return node;
 
+  if (state->data.clip.bounds.size.width == 0 ||
+      state->data.clip.bounds.size.height == 0)
+    return NULL;
+
   clip_node = gsk_clip_node_new (node, &state->data.clip.bounds);
   if (name)
     gsk_render_node_set_name (clip_node, name);